package fields;

import model.Board;
import model.Deck;
import model.Player;
import view.Boundary;
import cards.Card;

public class Chance extends Field {

	public Chance(int number, String name) {
		super(number, name);
		Boundary.setTitleText(number, "<b><font size=\"7\">?");
	}

	@Override
	public void landOnField(Player player) {
		Card card = Board.nextCard;
		Board.nextCard = Deck.draw();
		Boundary.displayChanceCard();
		Boundary.setChanceCard(Board.nextCard.getText());		
		Boundary.showMessage("You landed on " + getNumber() + " " + getName().replace("-<br>", "")
			+ ".");
				
		card.execute(player);
	}

	@Override
	public String toString() {
		return "Chance\t[" + super.toString() + "]";
	}
}